import request from '../request'
//获取token
import {getToken} from '@/util/getUser'
//登录
export function login(data) {
    return request(
        {
            url: "api/admin/login",
            method: "POST",
            data
        }
    )
}
//请求账号列表
export function accountList(data) {
    return request(
        {
            url: 'api/admin/accountList',
            method: "POST",
            data:{...data,token:getToken()}
        }
    )
}
//获取角色列表
export function getRoleLise(data){
    return request(
        {
            url: '/api/admin/roleLise',
            method: "POST",
            data:{...data,token:getToken()}
        }
    )
}
//获取角色权限列表
export  function getPermissionList(){
        return request(
            {
                url:'/api/admin/permissionList',
                method:'POST',
                data:{token:getToken()}
            }
        )
}
//角色新增修改
export function roleAddModify(data){
    return request({
        url:'/api/admin/roleAddModify',
        method:'POST',
        data:{...data,token:getToken()}
    })
}
//删除角色
export function accountDelete(data){
    return request({
        url:'api/admin/accountDelete',
        method:'POST',
        data:{...data,token:getToken()}
    })
}
//新增用户修改用户
export  function register(data){
    return request({
        url:'api/admin/register',
        method:"POST",
        data:{...data,token:getToken()}
    })
}
